const timeDifference = (startTime,endTime,herorderHours,orderHours)=>{ 
    var start1=startTime.split(":");
    var startAll=parseInt(start1[0]*60)+parseInt(start1[1]);   
    var end1=endTime.split(":");
    var endAll=parseInt(end1[0]*60)+parseInt(end1[1]); 
    let offset;
    let orderHour = parseInt(orderHours);
    if (endAll >= startAll) {
      offset = endAll-startAll-herorderHours-15;
    }else if (endAll < startAll) {
      offset = startAll - endAll-orderHours-15;
    }
    console.log("时间差==="+ offset);
    return offset;
};

const timeDifference2 = (startTime,endTime)=>{ 
    var start1=startTime.split(":");
    var startAll=parseInt(start1[0]*60)+parseInt(start1[1]);   
    var end1=endTime.split(":");
    var endAll=parseInt(end1[0]*60)+parseInt(end1[1]); 
    let offset;
    offset = endAll-startAll;
    return offset;
};

module.exports={
  timeDifference,
  timeDifference2
}
